package database_beans;
// Generated Feb 13, 2014 2:57:58 AM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Role generated by hbm2java
 */
@Entity
@Table(name="role"
    ,catalog="pia"
    , uniqueConstraints = @UniqueConstraint(columnNames="description") 
)
public class Role  implements java.io.Serializable {


     private Integer idRole;
     private String description;
     private Set<Korisnik> korisniks = new HashSet<Korisnik>(0);

    public Role() {
    }

	
    public Role(String description) {
        this.description = description;
    }
    public Role(String description, Set<Korisnik> korisniks) {
       this.description = description;
       this.korisniks = korisniks;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id_role", unique=true, nullable=false)
    public Integer getIdRole() {
        return this.idRole;
    }
    
    public void setIdRole(Integer idRole) {
        this.idRole = idRole;
    }

    
    @Column(name="description", unique=true, nullable=false, length=45)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="role")
    public Set<Korisnik> getKorisniks() {
        return this.korisniks;
    }
    
    public void setKorisniks(Set<Korisnik> korisniks) {
        this.korisniks = korisniks;
    }




}


